package spc.webos.queue;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import spc.webos.thread.DaemonThread;

public abstract class AccessThread extends DaemonThread {
	protected String bufferName;
	protected String qname;
	protected int rw;
	public static final int RW_READ = 0;
	public static final int RW_WRITE = 1;
	public static final List QUEUE_ACCESS_THREAD = new ArrayList();

	public AccessThread() {
		QUEUE_ACCESS_THREAD.add(this);
	}

	public int getRw() {
		return this.rw;
	}

	public String getQname() {
		return this.qname;
	}

	public void setQname(String qname) {
		this.qname = qname;
	}

	public void setRw(int rw) {
		this.rw = rw;
	}

	public Map checkStatus(Map param) {
		Map status = super.checkStatus(param);

		status.put("rw", new Integer(getRw()));
		return status;
	}

	public String getBufferName() {
		return this.bufferName;
	}

	public void setBufferName(String bufferName) {
		this.bufferName = bufferName;
	}
}
